package com.ruoyi.student.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.student.domain.vo.TSpecialityVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.student.mapper.TSpecialityMapper;
import com.ruoyi.student.domain.TSpeciality;
import com.ruoyi.student.service.ITSpecialityService;

/**
 * 专业Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-15
 */
@Service
public class TSpecialityServiceImpl implements ITSpecialityService 
{
    @Autowired
    private TSpecialityMapper tSpecialityMapper;

    /**
     * 查询专业
     * 
     * @param id 专业主键
     * @return 专业
     */
    @Override
    public TSpeciality selectTSpecialityById(Long id)
    {
        return tSpecialityMapper.selectTSpecialityById(id);
    }

    /**
     * 查询专业列表
     * 
     * @param tSpeciality 专业
     * @return 专业
     */
    @Override
    public List<TSpeciality> selectTSpecialityList(TSpeciality tSpeciality)
    {
        return tSpecialityMapper.selectTSpecialityList(tSpeciality);
    }
    @Override
    public List<TSpecialityVo> selectTSpecialityVoList(TSpeciality tSpeciality){
        return tSpecialityMapper.selectTSpecialityVoList(tSpeciality);
    }

    /**
     * 新增专业
     * 
     * @param tSpeciality 专业
     * @return 结果
     */
    @Override
    public int insertTSpeciality(TSpeciality tSpeciality)
    {
        tSpeciality.setCreateTime(DateUtils.getNowDate());
        return tSpecialityMapper.insertTSpeciality(tSpeciality);
    }

    /**
     * 修改专业
     * 
     * @param tSpeciality 专业
     * @return 结果
     */
    @Override
    public int updateTSpeciality(TSpeciality tSpeciality)
    {
        tSpeciality.setUpdateTime(DateUtils.getNowDate());
        return tSpecialityMapper.updateTSpeciality(tSpeciality);
    }

    /**
     * 批量删除专业
     * 
     * @param ids 需要删除的专业主键
     * @return 结果
     */
    @Override
    public int deleteTSpecialityByIds(Long[] ids)
    {
        return tSpecialityMapper.deleteTSpecialityByIds(ids);
    }

    /**
     * 删除专业信息
     * 
     * @param id 专业主键
     * @return 结果
     */
    @Override
    public int deleteTSpecialityById(Long id)
    {
        return tSpecialityMapper.deleteTSpecialityById(id);
    }
}
